package com.example.ssm.service.impl;

import com.example.ssm.dao.DaoFactory;
import com.example.ssm.dao.MenuDao;
import com.example.ssm.dao.ShopDao;
import com.example.ssm.entity.Bill;
import com.example.ssm.entity.Menu;
import com.example.ssm.service.MenuService;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.List;

@Service("MenuService")
public class MenuServiceImpl implements MenuService {

    @Override
    public boolean insertMennu(Menu menu) throws IOException {
        MenuDao dao= DaoFactory.getMenuDao();
        return dao.insertMennu(menu);
    }

    @Override
    public List<Menu> selectMenuByShopName(String shop_name) throws IOException {
        MenuDao dao= DaoFactory.getMenuDao();
        return dao.selectMenuByShopName(shop_name);
    }

    @Override
    public boolean delMenu(Menu menu) throws IOException {
        MenuDao dao= DaoFactory.getMenuDao();
        return dao.delMenu(menu);
    }

    @Override
    public List<Menu> selectAllMenu() throws IOException {
        MenuDao dao= DaoFactory.getMenuDao();

        return dao.selectAllMenu();
    }

    @Override
    public List<Menu> selectMenuById(Bill bill) throws IOException {
        MenuDao dao= DaoFactory.getMenuDao();

        return dao.selectMenuById(bill);
    }



    @Override
    public List<Menu> selectTypeshop_name(Menu menu) throws IOException {
        MenuDao dao= DaoFactory.getMenuDao();

        return dao.selectTypeshop_name(menu);
    }

    @Override
    public List<Menu> selectTypeName(Menu menu) throws IOException {
        MenuDao dao= DaoFactory.getMenuDao();

        return dao.selectTypeName(menu);
    }

    @Override
    public List<Menu> selectTypeprice(Menu menu) throws IOException {
        MenuDao dao= DaoFactory.getMenuDao();

        return dao.selectTypeprice(menu);
    }

    @Override
    public List<Menu> selectTypepshop_namename(Menu menu) throws IOException {
        MenuDao dao= DaoFactory.getMenuDao();

        return dao.selectTypepshop_namename(menu);
    }

    @Override
    public List<Menu> selectTypeppricename(Menu menu) throws IOException {
        MenuDao dao= DaoFactory.getMenuDao();

        return dao.selectTypeppricename(menu);
    }

    @Override
    public List<Menu> selectTypeppriceshop_name(Menu menu) throws IOException {
        MenuDao dao= DaoFactory.getMenuDao();

        return dao.selectTypeppriceshop_name(menu);
    }

    @Override
    public List<Menu> selectType(Menu menu) throws IOException {

        MenuDao dao= DaoFactory.getMenuDao();

        return dao.selectType(menu);
    }

}
